[coreclr] fix string runtimeconfig.json values#10669
Merged
jonathanpeppers merged 3 commits intomainfrom Jan 8, 2026
Merged
Conversation
`prop.Value.GetRawText ()` returns a string value `foo` as `"foo"`. Let's instead switch on `JsonValueKind` and handle each type appropriately. The existing `AppContextTests` should verify this when we enable the `RuntimeConfig` category.
51 tasks
8 tasks
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in RuntimePropertiesParser where JSON string values from runtimeconfig.json were being parsed with surrounding quotes (e.g., "foo" instead of foo) due to using GetRawText() for all value types. The fix switches on JsonValueKind to handle each JSON type appropriately, and enables the RuntimeConfig test category to verify the fix.
Key Changes:
- Implemented
GetJsonValueAsString()helper method that properly handles String, Boolean, Number, Object, Array, Null, and Undefined JSON types - Enabled
RuntimeConfigtest category for CoreCLR builds to activateAppContextTests - Fixed null value handling by skipping properties with null/undefined values
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Utilities/RuntimePropertiesParser.cs |
Added GetJsonValueAsString() method to properly convert JSON values to strings based on their JsonValueKind, fixing the string value parsing bug |
tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj |
Removed RuntimeConfig from the excluded test categories for CoreCLR, enabling AppContextTests to verify the fix |
Member
Author
jonathanpeppers
added a commit
that referenced
this pull request
Jan 21, 2026
`prop.Value.GetRawText ()` returns a string value `foo` as `"foo"`. Let's instead switch on `JsonValueKind` and handle each type appropriately. The existing `AppContextTests` should verify this when we enable the `RuntimeConfig` category.
jonathanpeppers
added a commit
that referenced
this pull request
Jan 21, 2026
`prop.Value.GetRawText ()` returns a string value `foo` as `"foo"`. Let's instead switch on `JsonValueKind` and handle each type appropriately. The existing `AppContextTests` should verify this when we enable the `RuntimeConfig` category.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

prop.Value.GetRawText ()returns a string valuefooas"foo".Let's instead switch on
JsonValueKindand handle each type appropriately.The existing
AppContextTestsshould verify this when we enable theRuntimeConfigcategory.